package com.h3c.ptability.task;

import com.h3c.ptability.service.IPtDeptService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import com.xxl.job.core.log.XxlJobLogger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@JobHandler(value="syncPtDeptHandler")
@Component
public class SyncPtDeptHandler extends IJobHandler {

    @Autowired
    private IPtDeptService ptDeptService;

    @Override
    public ReturnT<String> execute(String param) throws Exception {
        XxlJobLogger.log("XXL-JOB, syncPtDeptHandler.");
        XxlJobLogger.log("准备开始调用方法");
        ptDeptService.syncPtDept(true);
        XxlJobLogger.log("调用结束");
        return SUCCESS;
    }
}
